package club.gskj.gulimall.order.service;

import club.gskj.common.to.mq.SeckillOrderTO;
import club.gskj.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import club.gskj.common.utils.PageUtils;
import club.gskj.gulimall.order.entity.OrderEntity;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author 康纳-connor
 * @email 2417039231@gmail.com
 * @date 2021-03-27 16:26:19
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 创建订单信息
     *
     * @param vo
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo);

    OrderEntity getOrderStatusByOrderSn(String orderSn);

    void orderClose(OrderEntity orderEntity);

    /***
     * 根据订单号 查询订单支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPayInfoByOrderSn(String orderSn);

    /***
     *   查询当前登陆用户的订单、订单项
     * @param params
     * @return
     */
    PageUtils queryPageWithItems(Map<String, Object> params);

    /***
     *  根据支付宝发送的异步请求，处理订单信息
     * @param payAsyncVo 封装异步请求携带的数据
     */
    String handlePayResult(PayAsyncVo payAsyncVo);

    /**
     * 根据商品秒杀信息创建 订单
     *
     * @param orderEntity
     */
    void createSeckillOrder(SeckillOrderTO orderEntity);
}

